package com.creatshare.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;

import com.creatshare.service.BugService;
import com.creatshare.service.ProjectCategoryService;
import com.creatshare.service.ProjectService;
import com.creatshare.service.UserService;
import com.creatshare.util.ResultInfo;

@Controller
public class BaseController {
	protected HttpServletRequest request;
	protected HttpServletResponse response;
	protected HttpSession session;

	protected Integer result;
	protected ResultInfo resultInfo = new ResultInfo();
	@Resource
	protected UserService userService;

	@Resource
	protected BugService bugService;

	@Resource
	protected ProjectCategoryService projectCategoryService;

	@Resource
	protected ProjectService projectService;

	@ModelAttribute
	public void setReqAndRes(HttpServletRequest request, HttpServletResponse response) {
		this.request = request;
		this.response = response;
		this.session = request.getSession();
	}

	public HttpServletRequest getRequest() {
		return request;
	}

	public void setRequest(HttpServletRequest request) {
		this.request = request;
	}

	public HttpServletResponse getResponse() {
		return response;
	}

	public void setResponse(HttpServletResponse response) {
		this.response = response;
	}

	public HttpSession getSession() {
		return session;
	}

	public void setSession(HttpSession session) {
		this.session = session;
	}

}
